<!doctype html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <title>Document10</title>

    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.2.3/css/bootstrap.min.css" rel="stylesheet"
          crossorigin="anonymous"/>
</head>

<body>
<div class="container">
    <h2 class="page-header">Promise reject方法</h2>
</div>

<script>

    //Promise.reject方法将始终返回一个为失败的Promise对象，
    //    无论参数是否为Promise还是其他，最终都将返回失败的Promise

    const p2 = Promise.reject(new Promise((resolve, reject) => {
        resolve(345);
    }));
    console.log(p2);
</script>

</body>
</html>
